<?php

abstract class HTML_Fluent_XHTML_Element_Base_SCRIPT extends HTML_Fluent_Element {

    /**
     * The name of this element
     *
     * @return string
     */
    public function getName() {
        return 'script';
    }

    protected $attributes = array(
        'charset' => null,
        'defer' => null,
        'id' => null,
        'src' => null,
        'type' => null,
    );


    /**
     * Set the value of the 'charset' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_SCRIPT
     */
    public function charset($value) {
        return $this->setAttribute('charset', $value);
    }

    /**
     * Set the value of the 'defer' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_SCRIPT
     */
    public function defer($value) {
        return $this->setAttribute('defer', $value);
    }

    /**
     * Set the value of the 'id' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_SCRIPT
     */
    public function id($value) {
        return $this->setAttribute('id', $value);
    }

    /**
     * Set the value of the 'src' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_SCRIPT
     */
    public function src($value) {
        return $this->setAttribute('src', $value);
    }

    /**
     * Set the value of the 'type' attribute.
     *
     * @param string|null $value
     * @return HTML_Fluent_XHTML_Element_SCRIPT
     */
    public function type($value) {
        return $this->setAttribute('type', $value);
    }

    /**
     * Add a child text node
     *
     * @param string $string
     * @return HTML_Fluent_XHTML_Element_SCRIPT
     */
    public function text($string) {
        $this->childNodes[] = new HTML_Fluent_Text($string);
        return $this;
    }

}
